import { Module } from '@nestjs/common';
import { TypeOrmModule } from '@nestjs/typeorm';
import { AppController } from './app.controller';
import { AppService } from './app.service';
import { UsersModule } from './users/users.module';
import { AuthModule } from './auth/auth.module';
import { APP_GUARD } from '@nestjs/core';
import { JwtAuthGuard } from './auth/jwt-auth.guard';
import { BlogModule } from './blog/blog.module';
import { TagsModule } from './tags/tags.module';
import { SortsModule } from './sorts/sorts.module';

@Module({
  imports: [TypeOrmModule.forRoot(), UsersModule, AuthModule, BlogModule, TagsModule, SortsModule],
  controllers: [AppController],
  providers: [
    AppService,
    // 全局token守卫
    // {
    //   provide: APP_GUARD,
    //   useClass: JwtAuthGuard,
    // },
  ],
})
export class AppModule {}
